#!/usr/bin/env python
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

from swindle import device
from swindle import network


class CellularDevice(device.Device):
  def __init__(self, mgr, bus, name):
    self.bus = bus
    device.Device.__init__(self, mgr, bus, name)

  def enable(self):
    device.Device.enable(self)
    self.network = network.Network(self.bus, self, 'Fakenet')
    self.add_network(self.network)

  def disable(self):
    self.del_network(self.network)
    self.network.die()
    self.network = None
    device.Device.disable(self)

  def technology(self):
    return 'cellular'

  def iface(self):
    return 'cell0'
